The present invention relates to an information processing apparatus having a mechanism to manage a memory device such as a register file by dividing it into a set of register banks. More particularly, the invention relates to an information processing apparatus having a storage area managing mechanism suitable for managing, during the execution of a plurality of tasks, register sets, each of which is a part of an activation record, which control the execution of a program written by a procedural language.
The method of using a register file divided into a plurality of register banks was discussed by M. G. H. Katevenis in "Reduced Instruction Set Computer Architectures for VLSI", pp. 52 to 64, The MIT Press, 1985. According to this method, an activation record is generated each time a procedure is called and has information for controlling the execution of the program, and is assigned to the register set of the activation record in a new register bank within a resiger file on a chip. A current window pointer (CWP) always designates the register bank assigned to the register set currently controlling the execution of the program. If another procedure is called during the execution of a procedure for the program, the pointer CWP takes a new value which is a remainder of a division of the current pointer value+1 by the number of register banks. A new register set is then allocated to the register bank indicated by the new value of the pointer CWP. A plurality of register banks are cyclically allocated in the above manner.
If the nesting of procedure calls becomes deep, there occurs the case where all register banks within the register file are already used at the time of allocation of a new register set. This is called an over-flow of register file. In such a case, the content of earliest allocated register set in the register file is saved in a main storage, and the register bank to which the saved register set has been allocated is used for a new register set.
In a procedure return process (a process of returning to a calling procedure from the called procedure currently executed), the pointer CWP takes a new value which is a remainder of a division of the current pointer value-1 by the number of register banks. Then, the register bank having controlled the execution of the program until such time is released, and the control of the program is moved to the register set indicated by the new value of the pointer CWP.
Now that the register set of the called procedure is allocated to the register bank side by side with the register bank which that of the calling procedure is allocated to.
After repetitive generation of a procedure return process, there occurs the case where the content of register set to which the control of executing the program is to be transferred is not held in the register file. This is called an under-flow of the register file. The under-flow results from saving the associated register set into the main storage. In such a case, the last saved register set is fetched from the main storage and allocated to a register bank in the register file, to thereby transfer the control of executing the program to the fetched register set.
Further, according to the above-referenced background art, all the register sets allocated to the register banks in the register file at a certain time are used for controlling the execution of a single task. Therefore, it is apparent that the register sets allocated to two contiguous register banks are related to each other as a calling and a called procedure. In a task switch process for controlling the execution of a plurality of tasks, it becomes necessary for the task switch process to temporarily save, in the main memory, all the register sets allocated to the register banks in the register file, and allocate a new register set to a register bank in the register file.
Furthermore, the above-referenced background art does not consider at all an efficient execution and management of a plurality of tasks because the register sets for only one task currently executed are held in the register file within an instruction processing unit. It becomes necessary, therefore, for the task switch to temporarily save, in the main memory, all the register sets allocated to the register banks in the register file, and fetch one of a set of register sets for a new task to be held in the register file. During such operation, the program execution is suspended.
According to the above-referenced background art which performs the management of register set allocated to the register banks in the register file, it is possible to some extent, by increasing the capacity of the register file and the number of register sets held in the register file, to reduce the occurrence frequency of over-flow and under-flow of register file, and prevent the execution performance from being degraded because of saving and restoring of the register sets relative to the main storage at the over-flow and under-flow. However, with the above method, register sets for one task only are held in the register file. And, the occurrence frequency of a task switch process is maintained unchanged. Therefore, it takes a longer time for the task switch process to save the register sets in the register file into the main storage and allocate one of the register sets of the next active process to a register bank, resulting in degrading the total execution performance.
Another background art using a register file is discussed in U.S. Pat. No. 4,775,588 entitled "General-Purpose Register File Optimized For Intraprocedural Register Allocation, Procedure Calls, and Multitasking Performance".
According to this background art, the register file is divided into two areas, i.e., a global register area and a local register area. In the global register area, a register is accessed using a register number, and in the local register area a register is accessed by an offset value from a stack pointer. In addition, it is possible to designate the block of registers accessible by a task, by using a value in a protection register. In this connection, by setting the value of each protection register for a task so as not to overlap the blocks of registers accessible by respective tasks, it becomes possible to realize access protection, store data for a plurality of tasks at the same time, and realize a task switch without data transfer between registers and a memory.
With the above-described background art, however, the block of the global registers to be accessed by using a register number by each task is determined when an object program is made. As the number of tasks increases, it eventually leads to the case where a value of a protection register for a task cannot be determined unless allowing an overlap of its block to other blocks. Therefore, the data for such tasks having the overlapped blocks of registers cannot be stored in the register file at the same time.